package com.suning.sawp.intf.model.vo;

import java.util.List;

import org.apache.commons.lang3.StringUtils;

import com.suning.sawp.intf.model.ModelConstant;

/**
 * 样机管理<br>
 * 分配任务
 *
 * @author 15050519
 * @see [相关类/方法]（可选）
 * @since [产品/模块版本] （可选）
 */
public class ModelTaskInfoVo {

    /**
     * 任务id
     */
    private String taskId;
    
    /**
     * 任务开始时间yyyy.MM.dd
     */
    private String startTime;
    
    /**
     * 任务结束时间yyyy.MM.dd
     */
    private String endTime;
    
    /**
     * 样机库位编码
     */
    private String storageCode;
    
    /**
     * 样机库名称
     */
    private String storageStr;

    /**
     * 品类 品牌
     */
    private List<ModelTaskCateVo> cates;
    
    /**
     * 样机清单总数量
     */
    private int modelTotal;
    
    /**
     * 盘点数量
     */
    private int inventoryCnt;
    
    /**
     * 任务状态
     */
    private String taskStatus;
    
    /**
     * 任务状态编码
     */
    private String taskStatusCode;

    /**
     * 操作类型
     */
    private String oprType;
    
    /**
     * 暂无督导需分配数量
     */
    private int needAssign;
    
    /**
     * @return the taskId
     */
    public String getTaskId() {
        return taskId;
    }

    /**
     * @param taskId the taskId to set
     */
    public void setTaskId(String taskId) {
        this.taskId = taskId;
    }

    /**
     * @return the startTime
     */
    public String getStartTime() {
        return startTime;
    }

    /**
     * @param startTime the startTime to set
     */
    public void setStartTime(String startTime) {
        this.startTime = startTime;
    }

    /**
     * @return the endTime
     */
    public String getEndTime() {
        return endTime;
    }

    /**
     * @param endTime the endTime to set
     */
    public void setEndTime(String endTime) {
        this.endTime = endTime;
    }

    /**
     * @return the oprType
     */
    public String getOprType() {
        return oprType;
    }

    /**
     * @param oprType the oprType to set
     */
    public void setOprType(String oprType) {
        this.oprType = oprType;
    }

    /**
     * @return the cates
     */
    public List<ModelTaskCateVo> getCates() {
        return cates;
    }

    /**
     * @param cates the cates to set
     */
    public void setCates(List<ModelTaskCateVo> cates) {
        this.cates = cates;
    }

    /*
     * (non-Javadoc)
     * @see java.lang.Object#hashCode()
     */
    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((taskId == null) ? 0 : taskId.hashCode());
        return result;
    }

    /*
     * (non-Javadoc)
     * @see java.lang.Object#equals(java.lang.Object)
     */
    @Override
    public boolean equals(Object obj) {
        if (this == obj)
            return true;
        if (obj == null)
            return false;
        if (getClass() != obj.getClass())
            return false;
        ModelTaskInfoVo other = (ModelTaskInfoVo) obj;
        if (taskId == null) {
            if (other.taskId != null)
                return false;
        } else if (!taskId.equals(other.taskId))
            return false;
        return true;
    }

    /**
     * @return the storageCode
     */
    public String getStorageCode() {
        return storageCode;
    }

    /**
     * @param storageCode the storageCode to set
     */
    public void setStorageCode(String storageCode) {
        if (StringUtils.isBlank(this.storageStr) && StringUtils.isNotBlank(storageCode)) {
            this.setStorageStr(ModelConstant.getModelLibValue(storageCode));
        }
        this.storageCode = storageCode;
    }

    /**
     * @return the storageStr
     */
    public String getStorageStr() {
        return storageStr;
    }

    /**
     * @param storageStr the storageStr to set
     */
    public void setStorageStr(String storageStr) {
        this.storageStr = storageStr;
    }

    public int getModelTotal() {
        return modelTotal;
    }

    public void setModelTotal(int modelTotal) {
        this.modelTotal = modelTotal;
    }

    public int getInventoryCnt() {
        return inventoryCnt;
    }

    public void setInventoryCnt(int inventoryCnt) {
        this.inventoryCnt = inventoryCnt;
    }

    public String getTaskStatus() {
        return taskStatus;
    }

    public void setTaskStatus(String taskStatus) {
        this.taskStatus = taskStatus;
    }

    public int getNeedAssign() {
        return needAssign;
    }

    public void setNeedAssign(int needAssign) {
        this.needAssign = needAssign;
    }

    public String getTaskStatusCode() {
        return taskStatusCode;
    }

    /**
     * 设置任务状态名称
     * 功能描述: <br>
     * 〈功能详细描述〉
     *
     * @param taskStatusCode
     * @see [相关类/方法](可选)
     * @since [产品/模块版本](可选)
     */
    public void setTaskStatusCode(String taskStatusCode) {
        this.taskStatusCode = taskStatusCode;
        if (StringUtils.isNotBlank(taskStatusCode)) {
            setTaskStatus(ModelConstant.MODEL_TASK_STATUS_STR.get(taskStatusCode));
        }
    }
    
}
